using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.IO;

using projetSupinfoBFG.Screens;
using projetSupinfoBFG.Base;

#region Using Statements

#endregion
 
namespace projetSupinfoBFG
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game : Microsoft.Xna.Framework.Game
    {
        #region fields
        static readonly string[] preloadAssets =
        {
            "gradient",
        };

       
        ScreenManager screenManager;

        

        public GraphicsDeviceManager graphics;
       

        #endregion


        private static readonly TimeSpan WarningTime = TimeSpan.FromSeconds(20);
        TextureManager texturemanager;
       
        public Game()
        {
            Content.RootDirectory = "Content";
            graphics = new GraphicsDeviceManager(this);

            //Window size
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 533;
            graphics.ApplyChanges();

            //Create the screen manager component
            screenManager = new ScreenManager(this);
         
            Components.Add(screenManager);

            texturemanager = TextureManager.GetInstance(Content);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(this), null);

 
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            
            

            base.Initialize();
            this.IsMouseVisible = true;
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            foreach (string asset in preloadAssets)
            {
                Content.Load<object>(asset);
            }
           
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            // The real drawing happens inside the screen manager component.
            base.Draw(gameTime);
        }

       
    }
}
